<%-- 
    Document   : new_visit
    Created on : May 27, 2013, 3:38:33 PM
    Author     : Mansur
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.: Ship Visit :.</title>    
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.blockUI.js"></script>   
        <script type="text/javascript">
            $(function() {
                $("#datepicker2").datepicker({
                    showOn: "button",
                    buttonImage: "${pageContext.request.contextPath}/images/icon/calendar.gif",
                    buttonImageOnly: true,
                    changeMonth: true,
                    dateFormat: 'dd/mm/yy',
                    changeYear: true                    
                });
            });
            
            function clear(){
//                document.form1.
            }
            
            function unblockUI() {
                $.unblockUI();
            }
            
            function blockUI () {
                $.blockUI();
            }
        </script>
    </head>
    <body>
        <s:messages/>
        <s:errors/>
        <s:useActionBean beanclass="exatrez.stripes.util.ListUtil" var="list"/>
        <s:form beanclass="exatrez.stripes.action.ShipVisitAction" name="form1">               
            <div style="align:center">
                <fieldset>
                    <div id="page-title">
                        <span class="title">Search Staff Ship Visit</span>
                    </div>
                    <p>
                        <label>Department :</label>
                        <s:select name="departmentId" style="width:250px">
                            <s:option value="">Please Choose</s:option>
                            <s:options-collection collection="${list.listDepart}" label="departmentName" value="departmentId"/>
                        </s:select>
                    </p>
                    <p>
                        <label>Year :</label>
                        <c:set var="count" value="6"/>
                        <c:set var="now" value="<%=new java.util.Date().getYear() + 1900 %>"/>
                        <s:select name="currentYear" style="width:150px">
                            <s:option value="">Please Choose</s:option>
                            <s:option value="${now}">${now}</s:option>
                            <c:forEach var="i" begin="1" end="${count}">
                                <s:option value="${now - i}">${now - i}</s:option>
                            </c:forEach>
                        </s:select>
                    </p>
                    <p>
                        <label>&nbsp;</label>
                        <s:submit name="searchStaffVisit" value="Search" class="btn"/>
                    </p>
                    <div id="page-title">
                        <span class="title">History Ship Visited as per year ${actionBean.currentYear}</span>
                    </div>
                    <div style="align: center">
                        <display:table class="tablecloth" name="${actionBean.listCounter}" requestURI="/shipVisit?searchStaffVisit" id="line" style="width:80%">
                            <display:column title="No." sortable="true" ><center>${line_rowNum}.</center></display:column>
                            <display:column title="User ID" sortable="true">
                                <a href="shipVisit?searchStaffVisitDetail&staffId=${line.user.userId}">${line.user.userId}</a>
                            </display:column>
                            <display:column title="Target Visit" sortable="true" property="target"/>
                            <display:column title="No. of visit" sortable="true" property="visited"/>
                            <display:column title="Total Balance" sortable="true"><c:out value="${line.target - line.visited}" /></display:column>                 
                        </display:table>
                    </div>
                </fieldset>
            </div>
        </s:form>
    </body>
</html>
